package com.kaishengit.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.kaishengit.entity.Role;
import com.kaishengit.entity.User;
import com.kaishengit.service.ProjectService;
import com.kaishengit.service.RoleService;
import com.kaishengit.service.UserService;
import com.kaishengit.util.web.ServletUtil;

public class NewProject extends HttpServlet {

	private static final long serialVersionUID = 1L;


	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		List<User> list = new UserService().findAll();
		
		request.setAttribute("userList", list);
		ServletUtil.forword(request, response, "new_project");

	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		String name = request.getParameter("name");
		String desc = request.getParameter("desc");
		String manager = request.getParameter("manager");
		String member = request.getParameter("member");
		
		new ProjectService().save(name,desc);
		Role r = new Role();
		
	}

}
